fn extract_signal_names(signal_expr: &str) -> Vec<String> {
    let trimmed = signal_expr.trim();
    let mut signals = Vec::new();
    
    if trimmed.is_empty() {
        return signals;
    }
    
    if trimmed.contains('\'') {
        return signals;
    }
    
    if trimmed.starts_with('{') && trimmed.ends_with('}') {
        let inner = &trimmed[1..trimmed.len()-1];
        
        let parts: Vec<&str> = inner.split(',').collect();
        
        for part in parts {
            let part = part.trim();
            
            if part.contains('\'') {
                continue;
            }
            
            let signal_name = if let Some(idx) = part.find('[') {
                part[..idx].trim().to_string()
            } else {
                part.to_string()
            };
            
            if !signal_name.is_empty() {
                signals.push(signal_name);
            }
        }
        
        return signals;
    }
    
    let signal_name = if let Some(idx) = trimmed.find('[') {
        trimmed[..idx].trim().to_string()
    } else {
        trimmed.to_string()
    };
    
    if !signal_name.is_empty() {
        signals.push(signal_name);
    }
    
    signals
}

fn main() {
    println!("Test 1: {:?}", extract_signal_names("{TX_P,TX_N}"));
    println!("Test 2: {:?}", extract_signal_names("{RX_P,RX_N}"));
    println!("Test 3: {:?}", extract_signal_names("clk"));
    println!("Test 4: {:?}", extract_signal_names("data[7:0]"));
}
